<%-- 
    Document   : panier
    Created on : 21 avr. 2010, 22:51:17
    Author     : SaLaH
--%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <link rel="stylesheet" href="style.css" type="text/css" media="screen" />

        <title>CinéShop</title>
    </head>

    <body>
    <div class="PageBackgroundGradient"></div>
    <div class="Main">
        <div class="Sheet">
            <div class="Sheet-tl"></div>
            <div class="Sheet-tr"><div></div></div>
            <div class="Sheet-bl"><div></div></div>
            <div class="Sheet-br"><div></div></div>
            <div class="Sheet-tc"><div></div></div>
            <div class="Sheet-bc"><div></div></div>
            <div class="Sheet-cl"><div></div></div>
            <div class="Sheet-cr"><div></div></div>
            <div class="Sheet-cc"></div>
            <div class="Sheet-body">
              <%@include file="header.jsp" %>
                <div class="contentLayout">
              <%@include file="menu.jsp" %>
                    <div class="content">
                        

                                    <div> <h1><img src="images/ico-panier.png" alt="Panier" /> Panier </h1></div>
          <c:if test="${not empty typeError or not empty quantityError or not empty remainQuantityError  }">
 <div class="error"> ${typeError} ${quantityError}  ${remainQuantityError}</div>
         </c:if>

 <br/>
                   <c:if test="${empty lignesCommandes}">
                         <p> <center> Votre panier est vide !</center>
                       <p> <center> Veuillez <a href="ServletLoad" >poursuivre votre visite.</a></center>
                     </c:if>
                      <c:if test="${not empty lignesCommandes}">
                          <form action="traitementPanierServlet" id="CartForm" method="POST">

                               <div class="cart">
                                         <button class="Button" type="submit" name="COMMANDE">
                                                <span class="btn">
                                                    <span class="t">Passer la Commande</span>
                                                    <span class="r"><span></span></span>
                                                    <span class="l"></span>
                                                </span>
                                        </button>
                                    </div>
                              
                        <table style="border-collapse:collapse; border-width:1px; border-style:solid; border-color:black;" border="0" cellspacing="1" cellpadding="0" width="90%">
                            <thead>
                               
                                <tr>
                                    <td class="table-entete">Retirer</td>
                                     <td class="table-entete"></td>
                                    <td class="table-entete">Film</td>
                                    <td class="table-entete">Prix Unitaire<br> Euro</td>
                                    <td class="table-entete">Quantité</td>
                                    <td class="table-entete">Total<br> Euro</td>
                                </tr>
                            </thead>
                            <tbody>
                              
              
                                 <c:forEach var="ligneCommande" items="${lignesCommandes}">
                                    <tr>
                                          <td class = "table-ligne1">
                                              <a href="ServletUpdatePanier?id=${ligneCommande.id}" > <img src="images/retirer.gif" title="Supprimer l'article du panier"/></a>
                                        </td>
                                        <td class = "table-ligne1"><img src="images/films/${ligneCommande.film.image}" alt="" width="50"><br></td>
                                         <td class = "table-ligne1">${ligneCommande.film.titre} </td>
                                        <td class = "table-ligne1">${ligneCommande.film.prix}</td>
                                        <td class = "table-ligne1" >
                                            <input  type="text" style="width:40px; height:20px;" name="${ligneCommande.id}" value="${ligneCommande.quantite}" />

                                        </td>
                                        <td class = "table-ligne1">${ligneCommande.total}</td>
                                       
                                    </tr>
                                </c:forEach>
                               
                            </tbody>
                            <tbody>
                                   <tr>
                                       <td class = "table-ligne1"></td>
                                       <td class = "table-ligne1"></td>
                                        <td class = "table-ligne1"></td>
                                         <td class = "table-ligne1"></td>
                                    <td class = "table-ligne1"><strong>Montant global</strong></td>
                                    <td class = "table-ligne1">${total}</td>
                                </tr>
                                <tr>
                                    <td class = "table-ligne1" colspan="4">
                                        <button class="Button" type="submit" name="UPDATE_LINE_ITEM">
                                                <span class="btn">
                                                    <span class="t">Mettre à jour le panier</span>
                                                    <span class="r"><span></span></span>
                                                    <span class="l"></span>
                                                </span>
                                        </button>
                                       
                                    </td>
                                   
                                   <td class = "table-ligne1" colspan="2">
                                        <div class="cart">
                                         <button class="Button" type="submit" name="RETOUR">
                                                <span class="btn">
                                                    <span class="t">Poursuivre votre visite</span>
                                                    <span class="r"><span></span></span>
                                                    <span class="l"></span>
                                                </span>
                                        </button>
                                        </div>
                                        </td>
                                </tr>
                                <tr>

                                </tr>

                            </tbody>
                              <input type="hidden" id="actionUpdate" name="actionUpdate" value=""/>
                        </table>  
                    </form>
              </c:if>
                    </div>
                </div>

            </div>
        </div>

    </div>

</body>

</html>

